package com.sjgs.gis.quartz;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class JobSchedule implements CommandLineRunner {

    private static final Log logger = LogFactory.getLog(JobSchedule.class);

    @Autowired
    private QuartzService quartzService;

    /**
     * 任务调度开始
     * @param strings
     * @throws Exception
     */
    @Override
    public void run(String... strings) throws Exception {
        logger.info("start all job");
        quartzService.initScheduleJob();
        logger.info("finished all jobs");
    }
}